<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
  

    <div id="app2">
        <h1>app2</h1>

        
        <newcom1></newcom1>
        <newcom2></newcom2>


    </div>
    <script src="./vue.js"></script>
    <script>





        // 组件1注册
        let newcom1 = {

            data() {
                return {
                    msg: '  newcom1'
                }
            },
            template: "<div>  {{msg}}</div>"
        }
        // 组件2注册
        let newcom2 = {
            data() {
                return {
                    msg: '  newcom2'
                }
            },
            template: "<div>  {{msg}}</div>"
        }

        var vm2 = new Vue({

            el: '#app2',
            components: {
                newcom1,
                newcom2
            }

        })
    </script>
</body>

</html>